package com.my.code.jvm;

/**
 * JHSDB测试类
 * staticObj, instanceObj, localObj 存放在哪里？
 */
public class JhsdbTestCase {

    public static void main(String[] args) {
        Test test = new JhsdbTestCase.Test();
        test.foo();
    }

    static class Test{
        static ObjectHolder staticObj = new ObjectHolder();// 静态变量引用放在方法区
        ObjectHolder instanceObj = new ObjectHolder();// 普通成员变量引用放在堆中

        void foo() {
            ObjectHolder localObj = new ObjectHolder();// 局部变量引用则放在foo()方法栈帧的局部变量表中
            System.out.println("done");
        }
    }

    private static class ObjectHolder{}


}
